#include<iostream>
using namespace std;
typedef long long LL;
const int N = 1e5 + 10;
LL tree[N];
int n, m;

int lowbit(int x)
{
	return x & -x;
}

void add(int x, int c)
{
	for (int i = x; i <= n; i += lowbit(i)) {
		tree[i] += c;
	}
}

LL sum(int x)
{
	LL res = 0;
	for (int i = x; i; i -= lowbit(i)) {
		res += tree[i];
	}
	return res;
}
int main()
{
	cin >> n >> m;
	while (m--) {
		string op;
		int x, y;
		cin >> op >> x >> y;
		if (op == "x") {
			add(x, y);
		}
		else {
			cout << sum(y) - sum(x - 1) << endl;
		}
	}

	return 0;
}